package com.shardingjdbc.config;

import com.dangdang.ddframe.rdb.sharding.id.generator.IdGenerator;
import com.dangdang.ddframe.rdb.sharding.id.generator.self.CommonSelfIdGenerator;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * Sharding-jdbc提供主键生成器，就是一个会生成不重复Long值的类。
 * @author zhanglei01
 * @date 2020/9/22 9:23
 */
@Configuration
public class IdGeneratorConfig {

    @Bean
    public IdGenerator getIdGenerator() {
        return new CommonSelfIdGenerator();
    }
}
